#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>

typedef int HpDataType;
typedef struct Heap {
	HpDataType* a;
	int size;
	int capacity;
}Hp;

void HpInit(Hp* php);
void DestroyHeap(Hp* php);
void Swap(HpDataType* p1, HpDataType* p2);
void HeapPush(Hp* php, HpDataType x);
void HeapPop(Hp* php);
HpDataType HeapTop(Hp* php);
bool HeapEmpty(Hp* php);
int HeapSize(Hp* php);

void AdjustUp(HpDataType* a, int child);

void AdjustDown(HpDataType* a, int n, int parent);



